<?xml version="1.0" encoding="utf-8"?>
<ROOT>
  <CLUSTER>
    <PARAM name="clusterName" value="{{ cluster_name }}" />
    <PARAM name="nodeNames" value="{% for node in nodes %}{{ node.name }}{% if not loop.last %},{% endif %}{% endfor %}"/>
    <PARAM name="gaussdbAppPath" value="{{ gaussdb_app_path }}" />
    <PARAM name="gaussdbLogPath" value="{{ gaussdb_log_path }}" />
    <PARAM name="tmpMppdbPath" value="{{ tmp_mppdb_path }}"/>
    <PARAM name="gaussdbToolPath" value="{{ gaussdb_tool_path }}" />
    <PARAM name="corePath" value="{{ core_path }}"/>
    <PARAM name="backIp1s" value="{% for node in nodes %}{{ node.back_ip }}{% if not loop.last %},{% endif %}{% endfor %}"/>
  </CLUSTER>
  
  <DEVICELIST>
{% for node in nodes %}
    <DEVICE sn="{{ node.name }}">
      <PARAM name="name" value="{{ node.name }}"/>
      <PARAM name="azName" value="{{ node.az_name }}"/>
      <PARAM name="azPriority" value="{{ node.az_priority }}"/>
      <PARAM name="backIp1" value="{{ node.back_ip }}"/>
      <PARAM name="sshIp1" value="{{ node.ssh_ip }}"/>
{% if nodes | length > 1 %}
{% if node.cms_num is defined %}
      <PARAM name="cmsNum" value="{{ node.cms_num }}"/>
{% endif %}
{% if node.cm_server_port_base is defined %}
      <PARAM name="cmServerPortBase" value="{{ node.cm_server_port_base }}"/>
{% endif %}
{% if node.cm_server_listen_ip1 is defined %}
      <PARAM name="cmServerListenIp1" value="{{ node.cm_server_listen_ip1 }}"/>
{% endif %}
{% if node.cm_server_ha_ip1 is defined %}
      <PARAM name="cmServerHaIp1" value="{{ node.cm_server_ha_ip1 }}"/>
{% endif %}
{% if node.cm_server_level is defined %}
      <PARAM name="cmServerlevel" value="{{ node.cm_server_level }}"/>
{% endif %}
{% if node.cm_server_relation is defined %}
      <PARAM name="cmServerRelation" value="{{ node.cm_server_relation }}"/>
{% endif %}
{% endif %}
      <PARAM name="cmDir" value="{{ node.cm_dir }}"/>
{% if loop.first %}
      <PARAM name="dataNum" value="{{ node.data_num }}"/>
      <PARAM name="dataPortBase" value="{{ node.data_port_base }}"/>
      <PARAM name="dataNode1" value="{{ node.data_node1 }}"/>
{% if nodes | length > 1 %}
      <PARAM name="dataNode1_syncNum" value="{{ node.data_node1_sync_num }}"/>
{% endif %}
{% endif %}
{% if node.cm_server_port_standby is defined %}
      <PARAM name="cmServerPortStandby" value="{{ node.cm_server_port_standby }}"/>
{% endif %}
    </DEVICE>
{% endfor %}
  </DEVICELIST>
</ROOT>
